x86/HVM: fix miscellaneous aspects of x2APIC emulation
authorJan Beulich <jbeulich@suse.com>
Thu, 25 Sep 2014 12:07:27 +0000 (14:07 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 25 Sep 2014 12:07:27 +0000 (14:07 +0200)
commit70173dbb9948b13f423aabbd49d7f7cea6b34d1e
treed53fa81768b8f2e0071a4c45fc6151583f216e7a
parent43103612f62fb5d088bcbb8d5fcfcfeed7858b7c
x86/HVM: fix miscellaneous aspects of x2APIC emulation

- generate #GP on invalid APIC base MSR transitions
- fail reads from the EOI and self-IPI registers (which are write-only)
- handle self-IPI writes and the ICR2 half of ICR writes largely in
  hvm_x2apic_msr_write() and (for self-IPI only) vlapic_apicv_write()
- don't permit MMIO-based access in x2APIC mode
- filter writes to read-only registers in hvm_x2apic_msr_write(),
  allowing conditionals to be dropped from vlapic_reg_write()
- don't ignore upper half of MSR-based write to ESR being non-zero
- don't ignore other writes to reserved bits
- VMX's EXIT_REASON_APIC_WRITE must not result in #GP (this exit being
  trap-like, this exception would get raised on the wrong RIP)
- make hvm_x2apic_msr_read() produce X86EMUL_* return codes just like
  hvm_x2apic_msr_write() does (benign to the only caller)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/vlapic.c
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/vlapic.h